{extend name="base/common"}

{block name="style"}
<link href="__ADMIN__/css/plugins/iCheck/custom.css" rel="stylesheet">
<!-- Sweet Alert -->
<link href="__ADMIN__/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-lg-10">
		<h2>用户管理</h2>
		<ol class="breadcrumb">
			<li>
				<a href="index.html">Action</a>
			</li>
			<li class="active">
				<strong>Index</strong>
			</li>
		</ol>
	</div>
	<div class="col-lg-2">

	</div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>行为列表</h5>
						<div class="ibox-tools">
							<a class="collapse-link">
								<i class="fa fa-chevron-up"></i>
							</a>
							<a class="dropdown-toggle" data-toggle="dropdown" href="#">
								<i class="fa fa-wrench"></i>
							</a>
							<ul class="dropdown-menu dropdown-user">
								<li><a href="#">Config option 1</a>
								</li>
								<li><a href="#">Config option 2</a>
								</li>
							</ul>
							<a class="close-link">
								<i class="fa fa-times"></i>
							</a>
						</div>
					</div>
					<div class="ibox-content">
						<div class="table-responsive">
							<table class="table table-striped">
								<thead>
								<tr>
									<th><input class="i-checks check-all" type="checkbox"></th>
									<th class="">编号</th>
									<th class="">标识</th>
									<th class="">名称</th>
									<th class="">类型</th>
									<th class="">规则</th>
									<th class="">状态</th>
									<th class="">操作</th>
								</tr>
								</thead>
								<tbody>
								{volist name="_list" id="vo"}
									<tr>
										<td><input type="checkbox" class="i-checks" name="input[]"/></td>
										<td>{$vo.id}</td>
										<td>{$vo.name}</td>
										<td><a href="{:Url('editAction?id='.$vo['id'])}">{$vo.title}</a></td>
										<td><span>{:get_action_type($vo['type'])}</span></td>
										<td>{$vo.remark}</td>
										<td>{$vo.status_text}</td>
										<td><a href="{:Url('User/editAction?id='.$vo['id'])}">编辑</a>
											<a href="{:Url('User/setStatus?Model=action&ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_status_op}</a>
											<a href="{:Url('User/setStatus?Model=action&status=-1&ids='.$vo['id'])}" class="confirm ajax-get">删除</a>
										</td>
									</tr>
								{/volist}
								</tbody>
								<tfoot>
								<tr>
									<td colspan="8">
										<div class="page">{$_page}</div>
									</td>
								</tr>
								</tfoot>
							</table>
						</div>

					</div>
				</div>
			</div>
		</div>
	</div>
{/block}

{block name="script"}
<!-- Peity -->
<script src="__ADMIN__/js/demo/peity-demo.js"></script>
<script src="__ADMIN__/js/plugins/peity/jquery.peity.min.js"></script>
<!-- iCheck -->
<script src="__ADMIN__/js/plugins/iCheck/icheck.min.js"></script>

<!-- Sweet alert -->
<script src="__ADMIN__/js/plugins/sweetalert/sweetalert.min.js"></script>

<script>
	$(function(){
		$("#action_add").click(function(){
			window.location.href = $(this).attr('url');
		})
	});

	$(document).ready(function(){
		$('.i-checks').iCheck({
			checkboxClass: 'icheckbox_square-green',
			radioClass: 'iradio_square-green',
		});

		$('.user-delete').click(function () {
			swal({
				title: "你确定要删除吗？",
				text: "你确定要删除这条数据!",
				type: "warning",
				showCancelButton: true,
				confirmButtonColor: "#DD6B55",
				confirmButtonText: "是的,我要删除!",
				closeOnConfirm: false
			}, function () {
				swal("已经删除!", "你已经删除了这条数据!", "success");
			});

			return false;
		});


	});
</script>
{/block}


